﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) www.51mvc.com Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.51mvc.com/
 * Create By 小鱼(Leven)  - http://leven.com.cn
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Infancy.Core.Validation {
    /// <summary>
    /// 验证结果
    /// </summary>
    public class ValidatedResult {
        /// <summary>
        /// 验证结果
        /// </summary>
        public bool Result { get; protected set; }

        /// <summary>
        /// 验证完成后的所有信息
        /// </summary>
        public Dictionary<string, string> Errors { get; protected set; }

        public ValidatedResult()
            : this(true) {
        }

        public ValidatedResult(bool result) {
            Result = result;
            Errors = new Dictionary<string, string>();
        }

        public ValidatedResult(bool result, IDictionary<string, string> errors) {
            Result = result;
            Errors = new Dictionary<string, string>(errors);
        }
    }
}
